import layout from '@/components/layout/index'

const routes = [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: "登录"
    },
    component: () => import('@/views/login/login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    meta: {
      title: "首页"
    },
    component: layout,
    children: [
      {
        path: '/home',
        meta: {
          title: "首页"
        },
        component: () => import('@/views/home/home.vue')
      },
      {
        path: '/my',
        name: 'My',
        meta: {
          title: "我的信息"
        },
        component: () => import('@/views/my/my.vue')
      }
    ]
  },
  {
    path: '/campus',
    name: 'Campus',
    component: layout,
    meta: {
      title: "校园管理"
    },
    redirect: '/campus/ad',
    children: [
      {
        path: 'user',
        name: 'userList',
        meta: {
          title: "用户管理"
        },
        component: () => import('@/views/campus/user/index.vue')
      },
      {
        path: 'goodsCategory',
        name: 'goodsCategoryList',
        meta: {
          title: "分类管理"
        },
        component: () => import('@/views/campus/goods/category/index.vue')
      },
      {
        path: 'goods',
        name: 'goodsList',
        meta: {
          title: "商品管理"
        },
        component: () => import('@/views/campus/goods/index.vue')
      },
      {
        path: 'ad',
        name: 'adList',
        meta: {
          title: "广告管理"
        },
        component: () => import('@/views/campus/ad/index.vue')
      },
      {
        path: 'adPos',
        name: 'adPosList',
        meta: {
          title: "广告位管理"
        },
        component: () => import('@/views/campus/adPos/index.vue')
      },
      {
        path: 'withdraw',
        name: 'withdraw',
        meta: {
          title: "提现审核"
        },
        component: () => import('@/views/campus/withdraw/index.vue')
      },
      {
        path: 'complaint',
        name: 'complaint',
        meta: {
          title: "沸点列表"
        },
        component: () => import('@/views/campus/complaint/index.vue')
      },
      {
        path: 'partTimeJob',
        name: 'partTimeJob',
        meta: { title: '兼职管理' },
        component: () => import('@/views/campus/partTimeJob/index.vue')
      }
    ]
  },
  {
    path: '/sys',
    name: 'Sys',
    component: layout,
    meta: {
      title: "系统管理"
    },
    redirect: '/sys/user',
    children: [
      {
        path: 'role',
        name: 'RoleList',
        meta: {
          title: "角色管理"
        },
        component: () => import('@/views/system/role-list.vue')
      },
      {
        path: 'user',
        name: 'UserList',
        meta: {
          title: "用户列表"
        },
        component: () => import('@/views/system/sys-user-list.vue')
      },
      {
        path: 'menu',
        name: 'MenuList',
        meta: {
          title: "菜单管理"
        },
        component: () => import('@/views/system/menu-list.vue')
      }
    ]
  },
  {
    path: "/404",
    component: () => import("@/views/home/404.vue"),
    name: "404",
    meta: {
      title: "404",
      hideInMenu: true, // 不在菜单中显示
    },
  },
  {
    path: "/:pathMatch(.*)*",
    redirect: "/404",
    name: "Any",
    meta: {
      title: "404",
      hideInMenu: true,
    },
  },
]
export default routes;
